package com.itheima.dao;

import com.itheima.domain.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

import java.util.List;

public interface AccountDao {
    @Insert("insert into account(name,money) values(#{name},#{money})")
    public void save(Account account);

    @Delete("delete from account where id=#{id}")
    public void delete(Integer id);

    @Select("select * from account where id=#(id)")
    public Account findById(Integer id);

    @Select("select * from account")
    public List<Account> findAll();

    @Update("update account set name=#{name},money=#{money} where id=#{id}")
    public void upDate(Integer id);
}
